<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue 3 列表渲染示例</title>
    <script src="../libs/vue.global.min.js"></script>
</head>

<body>
    <!-- 定义 Vue 应用的挂载点 -->
    <div id="app">
        <!-- 使用 v-for 指令进行列表渲染 -->
        <ul>
            <li v-for="item in items" :key="item.id">{{ item.name }}</li>
        </ul>
    </div>

    <script>
        const { createApp } = Vue;
        const app = createApp({
            data() {
                return {
                    items: [
                        { id: 1, name: '苹果' },
                        { id: 2, name: '香蕉' },
                        { id: 3, name: '橙子' }
                    ]
                };
            }
        });

        // 挂载应用到 DOM 节点
        app.mount('#app');
    </script>
</body>

</html>